#pragma once

#include "../common/Common.h"
#include "../View/OsgViewerBase.h"

#include "PickableManager.h"

class Pickable : public Node
{
public:
	Pickable( OsgViewerBase * parentViewer )
	{
		_parentViewer = parentViewer;

		_parentViewer->getPickableManager()->registerPickable( this );
	}
	virtual ~Pickable()
	{
		_parentViewer->getPickableManager()->unregisterPickable( this );
	}

	virtual bool isPicked( int mouseScrX, int mouseScrY ) = 0;

	// actions
	virtual void onPick()								{}

	virtual void onCancelPick()							{}
	
	virtual void onDrag(int lastScrX, int lastScrY)		{ TOUCH( lastScrX ); TOUCH( lastScrY ); }

private:
	OsgViewerBase *			_parentViewer;
};
